package cn.org.donald.controller.game;

import cn.org.donald.framework.handler.HttpServletRequest;
import cn.org.donald.framework.pojo.vo.HttpResult;
import cn.org.donald.service.game.TestService;
import cn.org.donald.framework.base.BaseController;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author : Donald
 * @since : 2020/11/24 16:17
 */
@RestController
@RequestMapping("/game/test")
public class TestController extends BaseController {

    @Reference(version = "1.0.0", group = "donald")
    private TestService testService;

    @GetMapping("/getUserId")
    public HttpResult getUserIdFromRequest(HttpServletRequest request){
        Long userId = testService.getUserId(request);
        return toResultSuccess(userId);
    }
}
